package cn.arikeky.service.impl;

import cn.arikeky.domain.MoveUser;
import cn.arikeky.mapper.MoveUserMapper;
import cn.arikeky.result.JsonResult;
import cn.arikeky.service.IMoveUserService;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author director
 * @since 2022-11-23
 */
@Service
public class MoveUserServiceImpl extends ServiceImpl<MoveUserMapper, MoveUser> implements IMoveUserService {

    @Override
    public JsonResult watch(Long userId, Long movieId) {
        Wrapper<MoveUser> wrapper = new EntityWrapper<>();
        wrapper.eq("user_id", userId);
        wrapper.eq("movie_ticket_id", movieId);
        MoveUser selectOne = selectOne(wrapper);

        return JsonResult.success(selectOne);
    }
}
